﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sto6a00
    {
		private string _pid;
		private string _storageid;
		private double _storageqty;
		private string _listid;
		
        /// <summary>
        /// 货号
        /// </summary>
		public string Pid
		{
			get { return _pid;	 }
			set { _pid=value;	}
		}
        /// <summary>
        /// 仓库标识
        /// </summary>
		public string Storageid
		{
			get { return _storageid;	 }
			set { _storageid=value;	}
		}
        /// <summary>
        /// 库存数
        /// </summary>
		public double Storageqty
		{
			get { return _storageqty;	 }
			set { _storageqty=value;	}
		}
        /// <summary>
        /// 主键表示
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Sto6a00> GetSto6a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sto6a00> list = new List<Sto6a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sto6a00 model = GetSto6a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sto6a00 GetSto6a00ByDataRow(DataRow dr)
		{
			Sto6a00 model = new Sto6a00(); //实例化Sto6a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("pid")&&!(dr["pid"] is System.DBNull))  
				model.Pid = ( string)dr["pid"];
			if (dcc.Contains("storageid")&&!(dr["storageid"] is System.DBNull))  
				model.Storageid = ( string)dr["storageid"];
			if (dcc.Contains("storageqty")&&!(dr["storageqty"] is System.DBNull))  
				model.Storageqty = Convert.ToDouble(dr["storageqty"]);
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
